<template>
  <div id="sendmes">
    <div class="sendtop">
      <div class="ebtop">
        <div class="left">站内信</div>
      </div>
      <!-- 首页 -->
        <div class="sendhome">
            <button class="write" @click="writeEmail">写信</button>
            <div class="writenav">
                <table border="1" width = 100% cellspacing = 0 rules = none frame=void id="aaa">
                    <tr>
                        <th width="50%">内容</th>
                        <th width="25%">提交时间</th>
                        <th width="25%">状态</th>
                    </tr>
                </table>
            </div>
            <div class="content">
                <div class="box1">今天</div>
                <table border="1" width = 100% cellspacing = 0 rules = none frame=void id="aaa">
                    <tr class="box2" v-for="(item,index) in message" :key="index">
                      <!-- <td width="50%"> <input type="checkbox" v-model="checked" :value="item.mes"> mes</td> -->
                      <td width="50%">{{item.content}}</td>
                      <td width="25%">{{item.add_time}}</td>
                      <td width="25%">{{status[item.status-1]}}</td>
                    </tr>
                </table>
            </div>
            <!-- <div class="sendfoot">
                <input type="checkbox" v-model="checkAll" name="" id="">
                <button class="write">删除</button>
            </div> -->
        </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "sendmes",
  data() {
    return {
      // checkAll: false,
      // checked: [],
      status: ["未受理", "已受理"],
      name: "你好",
      content: "",
      message: []
    };
  },
  mounted() {
    this.loadmes();
  },

  methods: {
    loadmes() {
      this.axios
        .post("User/message_list")
        .then(({ data }) => {
          console.log(data);
          this.message = data.info;
        })
        .catch(function(error) {
          console.log(error);
        });
    },
    writeEmail() {
      this.$router.push("sendwrite");
    }
  }
};
</script>
<style lang="scss">
#sendmes {
  height: 100%;
  position: relative;
  .ebtop {
    // width: 100%;
    height: 55px;
    padding: 0 83px 0 25px;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(153, 153, 153, 1);
    box-shadow: 0 -10px #f2f2f2;
    background-color: #fff;
    z-index: 99;
    .left {
      font-size: 13px;
      font-family: MicrosoftYaHei-Bold;
      color: rgba(0, 0, 0, 1);
      font-weight: 700;
      line-height: 65px;
    }
  }
  .sendhome {
    .write {
      cursor: pointer;
      width: 97px;
      height: 39px;
      margin-top: 20px;
      margin-left: 30px;
      color: #fff;
      background: rgba(255, 169, 0, 1);
      // box-shadow:1px 1px 2px 0px rgba(255,255,255,0.5),0px -1px 2px 0px rgba(0,0,0,0.5);
      border-radius: 2px;
      line-height: 39px;
      text-align: center;
    }
    .writenav {
      height: 40px;
      padding-left: 50px;
      margin-top: 15px;
      line-height: 40px;
      font-size: 14px;
      color: #fff;
      text-align: left;
      background: rgba(224, 3, 0, 1);
    }
    .content {
      padding: 10px 20px;
      .box1 {
        line-height: 40px;
        border-bottom: 2px solid rgba(224, 3, 0, 1);
        padding-left: 10px;
      }
      .box2 {
        padding-left: 50px;
        line-height: 40px;
        border-bottom: 1px solid rgba(221, 221, 221, 1);
        td {
          padding-left: 20px;
        }
      }
    }
    .sendfoot {
      position: absolute;
      bottom: 20px;
      left: 30px;
      button {
        color: black;
        background: rgba(225, 225, 225, 1);
      }
    }
  }
  .btn {
    margin-top: 60px;
    button {
      cursor: pointer;
      width: 82px;
      height: 33px;
      background: rgba(224, 3, 0, 1);
      font-size: 12px;
      font-family: MicrosoftYaHei;
      color: rgba(255, 255, 255, 1);
      border-radius: 2px;
    }
    button:nth-of-type(2) {
      margin-left: 25px;
      background: rgba(225, 225, 225, 1);
      color: rgba(0, 0, 0, 1);
    }
  }
}
</style>
